.TH "IXP9SRV" 3 "2012 Dec" "libixp Manual"


.SH NAME

.P
Ixp9Srv, Ixp9Req, ixp_serve9conn

.SH SYNOPSIS

.nf
#include <ixp.h>

typedef struct Ixp9Srv Ixp9Srv;
struct Ixp9Srv {
        void* aux;
        void (*attach)(Ixp9Req*);
        void (*clunk)(Ixp9Req*);
        void (*create)(Ixp9Req*);
        void (*flush)(Ixp9Req*);
        void (*open)(Ixp9Req*);
        void (*read)(Ixp9Req*);
        void (*remove)(Ixp9Req*);
        void (*stat)(Ixp9Req*);
        void (*walk)(Ixp9Req*);
        void (*write)(Ixp9Req*);
        void (*wstat)(Ixp9Req*);
        void (*freefid)(IxpFid*);
}

typedef struct Ixp9Req Ixp9Req;
struct Ixp9Req {
        Ixp9Srv*        srv;
        IxpFid*         fid;    /* Fid structure corresponding to IxpFHdr.fid */
        IxpFid*         newfid; /* Corresponds to IxpFTWStat.newfid */
        Ixp9Req*        oldreq; /* For TFlush requests, the original request. */
        IxpFcall        ifcall; /* The incoming request fcall. */
        IxpFcall        ofcall; /* The response fcall, to be filled by handler. */
        void*           aux;    /* Arbitrary pointer, to be used by handlers. */

        /* Private members */
        ...
}

void ixp_serve9conn(IxpConn *c);
.fi


.SH DESCRIPTION

.P
The ixp_serve9conn handles incoming 9P connections. It is
ordinarily passed as the \fIread\fR member to \fBixp_listen(3)\fR with an
Ixp9Srv structure passed as the \fIaux\fR member. The handlers
defined in the Ixp9Srv structure are called whenever a matching
Fcall type is received. The handlers are expected to call
\fBixp_respond(3)\fR at some point, whether before they return or at
some undefined point in the future. Whenever a client
disconnects, libixp generates whatever flush and clunk events are
required to leave the connection in a clean state and waits for
all responses before freeing the connections associated data
structures.

.P
Whenever a file is closed and an \fBIxpFid(3)\fR is about to be freed,
the \fIfreefid\fR member is called to perform any necessary cleanup
and to free any associated resources.

.SH SEE ALSO

.P
ixp_listen(3), ixp_respond(3), ixp_printfcall(3),
IxpFcall(3), IxpFid(3)

.\" man code generated by txt2tags 2.6 (http://txt2tags.org)
.\" cmdline: txt2tags -o- Ixp9Srv.man3
